package com.siyuanren.gcocp.web;

import com.siyuanren.gcocp.common.web.bean.Result;
import com.siyuanren.gcocp.common.web.controller.BaseController;
import com.siyuanren.gcocp.dto.PartDTO;
import com.siyuanren.gcocp.dto.PartDetailDTO;
import com.siyuanren.gcocp.service.WordService;
import com.siyuanren.gcocp.vo.QueryPartListVO;
import com.siyuanren.gcocp.vo.QueryPartVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by   anxing
 * Project_name enword-java
 * Path         com.siyuanren.gcocp.web
 * Date         2018/7/19
 * Time         11:50
 * Description
 */
@Controller
@Slf4j
@RequestMapping("word")
public class WordController extends BaseController {
    @Autowired
    WordService wordService;

    @RequestMapping("getPartDetail")
    @ResponseBody
    public Result getPartDetail(QueryPartVO vo) {
        PartDetailDTO partDetail = wordService.getPartDetail(vo);
        return new Result(partDetail);
    }

    @RequestMapping("getPartList")
    @ResponseBody
    public Result getPartList(QueryPartListVO vo) {
        List<PartDTO> list = wordService.getPartList(vo);
        return new Result(list);
    }
}
